{% extends '!layout.html' %}

{% block extrahead %}
{{ super() }}
{% for content in extra_content_head %}
{{ content }}
{% endfor %}
{% endblock %}

<!-- Adding capability to control logo link in sidebartitle block -->
{%- block sidebartitle %}
{% set logo_dest = pathto(root_doc) %}
{% if logo_target_url %}
  {% set logo_dest = pathto(logo_target_url, 1) %}
{% endif %}
<a href="{{ logo_dest|e }}">

{%- if logo %}
  {#- Not strictly valid HTML, but it's the only way to display/scale
      it properly, without weird scripting or heaps of work
  #}
  {%- if sphinx_version_info < (4, 0) -%}
  <img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/>
  {%- else %}
  <img src="{{ logo_url }}" class="logo" alt="{{ _('Logo') }}"/>
  {%- endif %}
{%- endif %}

{%- if not theme_logo_only %}
<div class="wy-side-nav-project">
  {{ project }}
</div>
{%- endif %}
</a>

{%- if theme_display_version %}
  {%- set nav_version = version %}
  {%- if READTHEDOCS and current_version %}
    {%- set nav_version = current_version %}
  {%- endif %}
  {%- if nav_version %}
    <div class="version">
      {{ nav_version }}
    </div>
  {%- endif %}
{%- endif %}

{%- include "searchbox.html" %}

{%- endblock %}


{% block footer %}
{{ super() }}
{% for content in extra_content_footer %}
{{ content }}
{% endfor %}
{% endblock %}
